﻿using SqlSugar;

namespace ProductionManagement.Domain.Dtos.Dispathch
{
    public class AddDispathchDTO
    {
        /// <summary>
        /// 生产派工id
        /// </summary>
        public int DispatchId { get; set; }
        /// <summary>
        /// 生产派工编号
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(50)")]//设计长度
        public string? DNumber { get; set; }
        /// <summary>
        /// 生产派工主题
        /// </summary>
        /// 
        [SugarColumn(ColumnDataType = "Nvarchar(50)")]//设计长度

        public string? DisTopic { get; set; }
        /// <summary>
        /// 领料状态
        /// </summary>
        public int? DPickState { get; set; } = 1;
        /// <summary>
        /// 物料登记状态
        /// </summary>
        public int? DMaterState { get; set; } = 1;
        public string? MSubject { get; set; }
        /// <summary>
        /// 派工状态
        /// </summary>
        public int? DState { get; set; } = 1;
        /// <summary>
        /// 仓库入库id
        /// </summary>
        public int? WarehouseStorageId { get; set; }
        /// <summary>
        /// 人员档案id
        /// </summary>
        public int? ManpowerId { get; set; }
        /// <summary>
        /// 被派工人员
        /// </summary>
        public string? ManpowerName { get; set; }
        /// <summary>
        /// 产品id
        /// </summary>
        public int? ProductId { get; set; }
        /// <summary>
        /// 已派工数量
        /// </summary>
        public int? DAlreadyNum { get; set; }
        /// <summary>
        /// 本次派工数量
        /// </summary>
        public int? DThisNum { get; set; }
        /// <summary>
        /// 添加人姓名
        /// </summary>
        public string? AddName { get; set; }        

        /// <summary>
        /// 添加时间
        /// </summary>
        public DateTime? AddTime { get; set; }
        /// <summary>
        /// 修改人姓名
        /// </summary>
        public string? UpdName { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime? UpdTime { get; set; }
        /// <summary>
        /// 公司id
        /// </summary>
        public string? Office_Id { get; set; }

        /// <summary>
        /// 用户id
        /// </summary>
        public int? User_Id { get; set; }
        /// <summary>
        /// 派工产品
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(50)")]//设计长度
        public string? DispatchProd { get; set; }

        public List<DispatchProductss> DispatchProduct { get; set; }

        public List<DisMaterialss> DisMaterial { get; set; }
    }

    public class DispatchProducts
    {
        // 生产派工产品id
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int DispatchProductId { get; set; }

        /// <summary>
        /// 生产派工id
        /// </summary>
        public string? DNumber { get; set; }
        /// <summary>
        /// 产品id
        /// </summary>
        public int? ProductId { get; set; }
        public string? PName { get; set; }
        public string? PNumber { get; set; }
        public string? PSpec { get; set; }
        public string? PUnit { get; set; }
        /// <summary>
        /// 订单数量
        /// </summary>
        public int? OrderNum { get; set; }

        // 本次派工数量
        public int? DThisNum { get; set; }

        // 计划开工日期
        public DateTime? DPStartDate { get; set; }

        // 计划完工日期
        public DateTime? DPEndDate { get; set; }

        // 交货日期
        public DateTime? DDeliveryDate { get; set; }

        /// <summary>
        /// 添加人
        /// </summary>
        public string? AddName { get; set; }
        /// <summary>
        /// 添加时间
        /// </summary>
        public DateTime? AddTime { get; set; }
        /// <summary>
        /// 公司id
        /// </summary>
        public string? Office_Id { get; set; }

        /// <summary>
        /// 用户id
        /// </summary>
        public int? User_Id { get; set; }
    }

    public class DisMaterials
    {
        /// <summary>
        /// 生产物料id
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int DisMaterialId { get; set; }

        public string? DNumber { get; set; }
        /// <summary>
        /// 物料id
        /// </summary>
        public int MaterialId { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        public string? MSubject { get; set; }
        /// <summary>
        /// 仓库入库id
        /// </summary>
        public int? WarehouseStorageId { get; set; }
        /// <summary>
        /// 产品名称
        /// </summary>
        public string? MPNumber { get; set; }
        /// <summary>
        /// 产品编号
        /// </summary>
        public string? MPName { get; set; }
        /// <summary>
        /// 产品规格
        /// </summary>
        public string? MPSpec { get; set; }
        /// <summary>
        /// 产品单位
        /// </summary>
        public string? MPUnit { get; set; }
        public decimal? PRatio { get; set; }
        /// <summary>
        /// 产品现有库存
        /// </summary>
        public int? PStock { get; set; }
        /// <summary>
        /// 需要数量
        /// </summary>
        public int? NeedNum { get; set; }
        /// <summary>
        /// 到货日期
        /// </summary>
        public DateTime? ArrivalDate { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string? Remark { get; set; }
    }

}
